<?php
namespace app\common\exception;

use Exception;
use think\exception\Handle;
use think\exception\HttpException;

class Http extends Handle
{
    //错误类执行
    public function render(Exception $e)
    {
        if(request()->isAjax()){
            $message=$e->getMessage();
            return result(500,$message);
        }else{
            exit("<script>window.location.href = '/tpl/index/error404';</script>");
        }
        
//        //可以在此交由系统处理
          return parent::render($e);
    }

}